<?php

class FinanceModel extends Model{

    public $Model = array();

    public function _initialize(){
    }


    /**
     * 添加财务日志方法
     * @param unknown $member_id
     * @param unknown $type  
     * @param unknown $content
     * @param unknown $money
     * @param unknown $money_type  收入=1/支出=2
     * @param unknown $currency_id  币种id 0是rmb
     * @return 
     */
    public function addFinance($member_id,$type='TRADE_FEE',$content,$money,$money_type,$currency_id){
        $data['member_id']=$member_id;
        $data['type']=$type;
        $data['content']=$content;
        $data['money_type']=$money_type;
        $data['money']=$money;
        $data['add_time']=time();
        $data['currency_id']=$currency_id;
        $data['ip'] = get_client_ip();
        $list=$this->add($data);
        if($list){
            return $list;
        }else{
            return false;
        }
    }
    
}